//
//  NSString+GWBase64.m
//  ShandsMod
//
//  Created by 熊鑫 on 2021/10/8.
//  Copyright © 2021 zh_s. All rights reserved.
//

#import "NSString+GWBase64.h"

@implementation NSString (GWBase64)

///base64转图片
- (UIImage *)stringToImage {
    NSMutableString *outputStr = [NSMutableString stringWithString:self];
    if (outputStr.length<=0) {
        return nil;
    }
    NSString *resStr = [outputStr stringByReplacingOccurrencesOfString:@"data:image/png;base64," withString:@""];

    NSData * imageData =[[NSData alloc] initWithBase64EncodedString:resStr options:NSDataBase64DecodingIgnoreUnknownCharacters];
    
    UIImage *photo = [UIImage imageWithData:imageData ];
    
    return photo;
    
}

@end
